import { EditColumns } from "@/api/interface/EditColumns";
import { SysUser } from "./data";
import fields = SysUser.Fields;
import { DeepClone } from "@/utils/deepClone";

//获取[修改表单]的formRules
//fapi文档：http://www.form-create.com/v3/instance.html
export const GetUpdateFormRule = (cols: EditColumns): EditColumns => {
  //重写dic_value字段的rule
  // let dicValueNewRule: formFieldRule = { title: "字典值1" };
  // colsData.resetFormRule(fields.dic_value, dicValueNewRule);
  cols.setHidden(fields.role_ids, true);
  cols.setNotRequired(fields.password); //设置密码为非必填
  cols.setInputPlaceholder(fields.password, "密码不填则视为不修改"); //设置密码为非必填
  cols.setDisplay(fields.creator, false);
  // return JSON.parse(JSON.stringify(colsData));
  return DeepClone(cols);
};
